//
//  JHSLogInMainController.m
//  LogIn(登录)
//
//  Created by chenWei on 2017/3/22.
//  Copyright © 2017年 陈伟. All rights reserved.
//

#import "JHSLogInMainController.h"
#import "Masonry.h"
#import "JHSLogInDetailController.h"

@interface JHSLogInMainController ()


@end

@implementation JHSLogInMainController

- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBarHidden = YES;
    
}



- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    self.view.backgroundColor = [UIColor colorWithRed:116/ 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    
    //创建 UIImageView
    UIImageView *imgV = [[UIImageView alloc]init];
    
    imgV.image = [UIImage imageNamed:@"doctor_defaultphoto_male"];
    
    [imgV sizeToFit];
    
    imgV.layer.cornerRadius = 25;
    
    imgV.layer.masksToBounds = YES;
    
    [self.view addSubview:imgV];
    
    [imgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(100);
        make.centerX.offset(-100);
        make.size.mas_offset(CGSizeMake(50, 50));
    }];
    

    
    //添加登录 btn
    UIButton *btn = [[UIButton alloc]init];
    
    [btn setTitle:@"登录" forState:UIControlStateNormal];
    
    [btn setBackgroundImage:[UIImage imageNamed:@"link_button_01"] forState:UIControlStateNormal];
    
    //添加监听事件
    [btn addTarget:self action:@selector(push) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:btn];
    
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(imgV.mas_bottom).offset(20);
        make.centerX.equalTo(imgV.mas_centerX);
        make.size.mas_offset(CGSizeMake(100, 20));
    }];
    
    
    
}

//MARK:1-跳转到登录界面
- (void)push
{
    JHSLogInDetailController *logInVC = [[JHSLogInDetailController alloc]initWithNibName:@"JHSLogInDetailController" bundle:nil];
    
    [self.navigationController pushViewController:logInVC animated:YES];
    
}




@end
